<?
require_once 'config.php';
$input_email = getValue('input_email','str','POST','');
if($input_email == '') redirect('/');
$id_field = 'eqt_id';
$eqt_date = time();
   $myform = new generate_form();

   $myform->add('eqt_cus_email', 'input_email', 0, 1, '', 1, 'Bạn chưa nhập email', 1, 'Email này bạn đã đăng ký nhận báo giá rồi !');
   $myform->add('eqt_date', 'eqt_date', 1, 1, 0, 0, '', 0, '');
   $myform->addTable('email_quote');
   
   
   $action	= getValue('action', 'str', 'POST', '');
   if($action			==	'excute'){
      $errorMsg_res = '';
      $errorMsg_res		.=	$myform->checkdata();
         if($errorMsg_res == ''){
            $db_ex		=	new db_execute_return();
       			$last_id		=	$db_ex->db_execute($myform->generate_insert_SQL());
       			if($last_id	> 0){   			
       			  send_mailer('vattucongnghiepdonganh@gmail.com',"Khách hàng gửi email nhận báo giá",'Kiểm tra hệ thống để xem khách hàng gửi email nhận báo giá mới nhất',"");
    		         echo "<script>alert('Bạn đã gửi email nhận báo giá thành công !');</script>";
               }
    			
         }
   }
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link type="image/x-icon" href="/favicon.ico" rel="icon" />
   
   <title></title>
   <meta name="description" content=""/>
   <meta name="keywords" content=""/>
   <meta name="AUTHOR" content="Vnupdate" />
   <meta name="COPYRIGHT" content="" />
   <meta name="ROBOTS" content="INDEX, FOLLOW" />
   <meta name="RATING" content="GENERAL" />
   
   <meta property="og:title" content="" />
   <meta property="og:type" content="website" />
   <meta property="og:url" content="" />
   <meta property="og:image" content="" />
   <meta property="og:site_name" content="" />
   <meta property="og:description" content="" />
   <meta property="fb:admins" content="" />
   <meta property="fb:app_id" content=""/> 
   <!-- css -->   
   <link rel="stylesheet" type="text/css" href="<?=TEMPLATE_PATH?>css/home.css" />	
   <link rel="stylesheet" type="text/css" href="<?=TEMPLATE_PATH?>css/order.css" />
   <!-- js -->
   <script type="text/javascript" src="<?=TEMPLATE_PATH?>js/jquery-1.9.0.min.js"></script>
   <script type="text/javascript" src="<?=TEMPLATE_PATH?>js/common.js"></script>
</head>
<body>   
   <? include('view/common/vic_header.php');?>
   <div class="global_container">
      <div class="slider">
         <?include('view/common/vic_slide.php')?>
      </div>
      <div class="content_wrap">
         <div class="content_left">
            <?include('view/common/vic_content_left.php')?>
            
         </div>
         <div class="content_right">
            <div class="products_hot_wrap">
               <h1 class="pro_hot_title">
                  Cảm ơn bạn đã gửi email để nhận báo giá !
               </h1>
            </div>
         </div>
      </div>
      <?include('view/common/vic_social_networking.php');?>
   </div>
   <?include('view/common/vic_footer.php');?>
</body>
</html>
